package com.example.lotterysystem.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.lotterysystem.dao.dataobject.Prize;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.io.Serializable;
import java.util.List;

@Mapper
public interface PrizeMapper extends BaseMapper<Prize> {
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    @Override
    int insert(Prize entity);

    @Select("select * from prize order by id desc limit #{pageSize} offset #{offset}")
    List<Prize> selectPrizeList(@Param("offset") Integer offset,
                                @Param("pageSize") Integer pageSize);
}
